package com.lepu.app.main.pay.bean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

public class WxPayCallBean {

	public String TradeNo;//	充值订单号
	public String TradeState;//	支付结果
	public String ErrorCodeDes;//	错误描述
	
	/*
	 * 解析数据
	 */
	public static WxPayCallBean parseJsonData(String dataString)
	{
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONObject obj2 = (JSONObject) obj1.get("DetailInfo");
			
			result = obj2.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
		Gson gson = new Gson();
		WxPayCallBean item = gson.fromJson(result,
				new TypeToken<WxPayCallBean>() {
				}.getType());
		return item;
	}

}
